﻿using BingoClientModel;
using BingoServerCommon.Common;

namespace BingoGameServerConsole
{
	/// <玩家请求房间人数和卡数 />
	public class PackageRequestPlayerNum : Package
	{


		public PackageRequestPlayerNum(EnumPackCommand mainid) : base(mainid)
		{
		}

		public PackageRequestPlayerNum(byte[] buffer, int len) : base(buffer, len)
		{
		}

		public override Package Clone(byte[] bytes)
		{
			return new PackageRequestPlayerNum(bytes, bytes.Length);
		}
		/// <summary>
		/// 
		/// </summary>
		public override void Excute(BaseRoom baseroom, Session session)
		{
            //User user = (User)session.player;
            Room room = (Room)baseroom;

            int cardnum = room.GetCardNum();
            int playnum =room.GetPlayerUserNum();
            Package pack = new Package(EnumPackCommand.GC_RequestPlayerNum_Ret);
            pack.Write(cardnum);
            pack.Write(playnum);
            GameTcpServer.SendPackage(session.ConnId, pack);
        }
	}
}
